package com.web44.spring.bean;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.Map;

/**
 * @Title: Student
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/8 11:22
 */
@Data
@ToString
public class Student {

    private Integer id;

    private String name;

    private Integer age;

    private String sex;

    private String express;

//     添加班级属性
    private Clazz clazz;
    // 学生爱好
    private String[] hobbies;

    private Map<String,Teacher> teacherMap;



    public Student() {
        System.out.println("创建对象.....");
    }

    public Student(Integer id, String name, Integer age, String sex) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public Student(Integer id, String name, Integer age, String sex, Clazz clazz) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.clazz = clazz;
    }

    public void setName(String name) {
        System.out.println("注入成功....");
        this.name = name;
    }

    private void initMethod() {
        System.out.println("调用方法之前....");
    }

    private void destroyMethod() {
        System.out.println("销毁....");
    }
}
